<div class="rule-actions-expand fade-in-right">
  <div *ngIf="isMasterRole(); else isMemberRole" class="grid-space-evenly"
    style="display: flex;">
    <div *ngIf="isMasterCluster(); else isMemberCluster">
      <em
        class="eos-icons icon-18 hand "
        matTooltip="{{ 'multiCluster.tips.policy' | translate }}"
        (click)="manageFedPolicy()"
      >gavel</em>
      <em
        class="eos-icons icon-18 hand"
        matTooltip="{{ 'multiCluster.tips.demote' | translate }}"
        (click)="demote(params.data)"
      >recycling</em>
      <em
        class="eos-icons icon-18 hand"
        matTooltip="{{ 'multiCluster.tips.token' | translate }}"
        (click)="generateToken()"
      >vpn_key</em>
      <em
        class="eos-icons icon-18 hand"
        matTooltip="{{ 'multiCluster.tips.edit' | translate }}"
        (click)="showEditClusterDialog(
        $event, params.data, params.context, false);
        $event.stopPropagation();"
      >mode_edit</em>
    </div>
    <ng-template #isMemberCluster>
      <div *ngIf="
      params.data &&
      ( params.data.status === left_status ||
                params.data.status === disconnect_status ||
                params.data.status === upgrade_status ||
                params.data.status === kicked_status);
           else valid_status" class="grid-space-evenly" style="display: flex;">
        <em
          class="eos-icons icon-18 hand disabled-color"
          matTooltip="{{ 'multiCluster.tips.syncPolicy' | translate }}"
        >sync</em>
        <em
          class="eos-icons icon-18 hand"
          matTooltip="{{ 'multiCluster.tips.remove' | translate }}"
          (click)="removeMember(params.data)"
        >person_off</em>
        <em
          class="eos-icons icon-18 hand disabled-color"
          matTooltip="{{ 'multiCluster.tips.manage' | translate }}"
        >laptop_windows</em>
      </div>
      <ng-template #valid_status>
        <em
          class="eos-icons icon-18 hand"
          matTooltip="{{ 'multiCluster.tips.syncPolicy' | translate }}"
          (click)="syncPolicy(params.data)"
        >sync</em>
        <em
          class="eos-icons icon-18 hand"
          matTooltip="{{ 'multiCluster.tips.remove' | translate }}"
          (click)="removeMember(params.data)"
        >person_off</em>
        <em
          class="eos-icons icon-18 hand"
          matTooltip="{{ 'multiCluster.tips.manage' | translate }}"
          (click)="manageCluster(params.data)"
        >laptop_windows</em>
      </ng-template>


    </ng-template>

  </div>
  <ng-template #isMemberRole>
    <div *ngIf="!isMasterCluster()" class="grid-space-evenly" style="display: flex;">
    <em
      class="eos-icons icon-18 hand"
      matTooltip="{{ 'multiCluster.tips.edit' | translate }}"
      (click)="showEditClusterDialog($event, params.data, params.context, false)"
    >mode_edit</em>
    <em
      class="eos-icons icon-18 hand"
      matTooltip="{{ 'multiCluster.tips.leave' | translate }}"
      (click)="leave()"
    >person_off</em>
    </div>
  </ng-template>
</div>

<div *ngIf="isMasterRole() || !isMasterCluster()" class="rule-actions-collapse">
  <em class="fa fa-ellipsis-h fa-lg mr-sm text-action hand">
  </em>
</div>
